import React from 'react'
import { MessageItemType } from '@/typings/message'
import styles from './index.module.less'
import avatar from '@/assets/avatar.png'

interface Props {
  messageItem: MessageItemType
}

/**
 * @description 消息列组件
 */
const MessageItem: React.FC<Props> = (props: Props) => {
  const { messageItem } = props
  return (
    <div className={styles.item}>
      {/* 头像 */}
      <div className={styles.left}>
        <img src={avatar} alt="" className={styles.avatar} />
      </div>
      <div className={styles.right}>
        <div className={styles.rightTop}>{messageItem.sendUser}</div>
        <div className={styles.rightBottom}>{messageItem.messageInfo}</div>
      </div>
    </div>
  )
}

export default MessageItem
